<!doctype html>
<html>
<head>
<meta charset="utf-8">

<link href="../css/esearch.css" rel='stylesheet' type='text/css'>

<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="../tinymce/js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
    selector: "textarea"
 });
</script>
<?php

include('../php/db.php');

if ($_SESSION['login'] == NULL)
{
 header("Location: ../index.php");	
}
else
{
$login = $_SESSION['login'];

}
			?>

<title>

</title>
      
 <style type="text/css">
	#tfheader{
		background-color:#c3dfef;
		width:927px;
	}
	#tfnewsearch{
		float:right;
		padding:20px;
		margin-right: 100px;
	}
	.tftextinput{
		margin: 0;
		padding: 5px 15px;
		font-family: Arial, Helvetica, sans-serif;
		font-size:14px;
		border:1px solid #0076a3; border-right:0px;
		border-top-left-radius: 5px 5px;
		border-bottom-left-radius: 5px 5px;
	}
	.tfbutton {
		margin: 0;
		padding: 5px 15px;
		font-family: Arial, Helvetica, sans-serif;
		font-size:14px;
		outline: none;
		cursor: pointer;
		text-align: center;
		text-decoration: none;
		color: #ffffff;
		border: solid 1px #0076a3; border-right:0px;
		background: #0095cd;
		background: -webkit-gradient(linear, left top, left bottom, from(#00adee), to(#0078a5));
		background: -moz-linear-gradient(top,  #00adee,  #0078a5);
		border-top-right-radius: 5px 5px;
		border-bottom-right-radius: 5px 5px;
	}
	.tfbutton:hover {
		text-decoration: none;
		background: #007ead;
		background: -webkit-gradient(linear, left top, left bottom, from(#0095cc), to(#00678e));
		background: -moz-linear-gradient(top,  #0095cc,  #00678e);
	}
	/* Fixes submit button height problem in Firefox */
	.tfbutton::-moz-focus-inner {
	  border: 0;
	}
	.tfclear{
		clear:both;
	}
</style>      
        
</head>
<body style="background-color:white;">
<?php
 include __DIR__ . "/../php/header.php";

?>

<div class="search-container" style="position:relative; margin-top:70px; margin-left: 222px; margin-right: 200px;">
	<div id="tfheader">
		<form id="tfnewsearch" method="get" action=''>
		        <select class="tftextinput" name="yrs" id="yrs">
		        	<option value="null" disabled selected> Select years of experience </option>
		        	<option value="Non-Executive"> Non-Executive </option>
                    <option value="Fresh Grad / < 1 Year Experienced Employee">Fresh Grad / < 1 Year Experienced Employee </option>
		        	<option value="1-4 Years Experienced Employee">1-4 Years Experienced Employee</option>
		        	<option value="Supervisor / 5 Years & Up Experienced Employee">Supervisor / 5 Years & Up Experienced Employee</option>
		        	<option value="Assistant Manager / Manager">Assistant Manager / Manager</option>
		        	<option value="CEO / SVP / AVP / VP / Director">CEO / SVP / AVP / VP / Director</option>
		        </select>

		        <input type="text" class="tftextinput" id="educ" name="educ" size="21" maxlength="120" placeholder="educ attainment"><input type="submit" value="search" class="tfbutton">
		</form>
		
	<div class="tfclear"></div>
	</div>
	<center style="margin-top:20px;"><font size=5px; style="font-family:'Gadugi';">Applicant Search Query</center></font>
	<hr style="border-top:dotted .5px; margin-top:20px;">
	<hr style="border-top:dotted .5px; margin-top:15px;">
	<div class="searchforcandidates">
		<table width=100%>
			<tr>
			<th>Applicant Photo</th>
			<th>Applicant Name</th>
			<th>Educational Attainment</th>
			<th>Years of Job Experience</th>
			</tr>
			<?php
			$yrsofexp = $_GET['yrs'];
			$educat = $_GET['educ'];
			$getallapplicants = mysql_query("SELECT a.photo as photo, a.applicant_id as id, CONCAT(a.fname,' ', a.lname) as fullname, a.photo as photo, ed.educ_level as educ, ex.explevel as xp ,a.refid as refid
				FROM applicant a
				left join a_educ ed on ed.applicant_id = a.applicant_id
				left join a_experience ex on ex.applicant_id = a.applicant_id
				left join educ_attainment el on ed.educ_level = el.educ_level
				left join year_experienced ye on ye.yr_ID = ex.explevel 
				WHERE ex.explevel LIKE '%$yrsofexp%' OR el.descirption LIKE '%$educat%'") or die(mysql_error());
			
			while($rowapp = mysql_fetch_array($getallapplicants)) { 
			  $cphoto = $rowapp['photo'];
			$photo = empty($cphoto) ? DEFAULT_COVER : IMAGE_URL_SMALL.$cphoto;

			?>
            <tr id="id_<?=$rowapp['id']?>">
			<td align="center"><img id="myPic" src="<?=$photo?>" width="100" height="100"></td>
			<td align="center"><a href="../applicant/viewapplicant.php?refid=<?=$rowapp['refid']?>" onClick="window.open(this.href,'popupwindow','left=200,top=50,width=1000,height=600,scrollbars=yes,menu=0,status=0'); return false;"><?=$rowapp['fullname']?></a></td>
			<td align="center"><?=$rowapp['educ']?></td>
			<td align="center"><?=$rowapp['xp']?></td>
			</tr>
            <tr>
            <td width="25%;" >
            <hr style="border-top:dotted 1px;">
            </td>
            <td width="20%;">
            <hr style="border-top:dotted 1px;">
            </td>
            <td width="20%;">
            <hr style="border-top:dotted 1px;">
            </td>
            <td width="100%;">
            <hr style="border-top:dotted 1px;">
            </td>
            </tr>
			<?php } ?>
		</table>
	</div>
</div>



		<div class="footer">
        	
            <div style="margin-top:20px; float:left; width:100%;">
            <center>
            
            <p>Copyright @ Famous Labor Supply Service Alright Reserve 2015</p>
            </center>
            </div>
        </div>   



</body>
</html>